// 常量定义

// 账户分类枚举
export const ACCOUNT_TYPES = {
  PRODUCT: 1,    // 产品账户
  TA: 2          // TA账户
}

// 账户分类标签
export const ACCOUNT_TYPE_LABELS = {
  [ACCOUNT_TYPES.PRODUCT]: '产品账户',
  [ACCOUNT_TYPES.TA]: 'TA账户'
}

// 数据状态枚举
export const DATA_STATUS = {
  INACTIVE: 0,   // 失效
  ACTIVE: 1      // 有效
}

// 数据状态标签
export const DATA_STATUS_LABELS = {
  [DATA_STATUS.INACTIVE]: '失效',
  [DATA_STATUS.ACTIVE]: '有效'
}

// 分页大小
export const PAGE_SIZE = 10

// 表格列配置
export const TABLE_COLUMNS = [
  {
    title: '序号',
    key: 'index',
    width: 80,
    align: 'center'
  },
  {
    title: '开户机构',
    dataIndex: 'acctInstitution',
    key: 'acctInstitution',
    width: 150
  },
  {
    title: '账户分类',
    dataIndex: 'acctType',
    key: 'acctType',
    width: 120
  },
  {
    title: '证书ID',
    dataIndex: 'certificateId',
    key: 'certificateId',
    width: 150
  },
  {
    title: '备注',
    dataIndex: 'remark',
    key: 'remark',
    ellipsis: true
  },
  {
    title: '数据状态',
    dataIndex: 'dataStatus',
    key: 'dataStatus',
    width: 100,
    align: 'center'
  },
  {
    title: '操作',
    key: 'action',
    width: 150,
    align: 'center'
  }
]

// 模拟数据
export const MOCK_DATA = [
  {
    id: 1,
    acctInstitution: 'icbc',
    acctType: 1,
    certificateId: 'CERT001',
    remark: '产品账户证书',
    dataStatus: 1,
    createdBy: 'admin',
    createdDate: '2024-01-01 10:00:00',
    updatedBy: 'admin',
    updatedDate: '2024-01-01 10:00:00'
  },
  {
    id: 2,
    acctInstitution: 'ccb',
    acctType: 2,
    certificateId: 'CERT002',
    remark: 'TA账户证书',
    dataStatus: 1,
    createdBy: 'admin',
    createdDate: '2024-01-02 10:00:00',
    updatedBy: 'admin',
    updatedDate: '2024-01-02 10:00:00'
  }
]

// 表单验证规则
export const FORM_RULES = {
  acctInstitution: [
    { required: true, message: '请选择开户机构', trigger: 'change' }
  ],
  acctType: [
    { required: true, message: '请选择账户分类', trigger: 'change' }
  ],
  certificateId: [
    { max: 150, message: '证书ID不能超过150个字符', trigger: 'blur' }
  ],
  remark: [
    { max: 500, message: '备注不能超过500个字符', trigger: 'blur' }
  ]
}